package com.yakumosakura.yakumoblade.client;

import com.yakumosakura.yakumoblade.compat.YATouHouMaidItem;
import com.yakumosakura.yakumoblade.registry.slashblade.YAItem;
import mods.flammpfeil.slashblade.client.renderer.model.BladeModel;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.item.ClampedItemPropertyFunction;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.registries.ForgeRegistries;

import javax.annotation.Nullable;

import static com.yakumosakura.yakumoblade.Yakumoblade.MODID;
import static mods.flammpfeil.slashblade.client.ClientHandler.bakeBlade;
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ClientHandler {



    @SubscribeEvent
    public static   void doClientStuff( FMLClientSetupEvent event) {
        ItemProperties.register( YATouHouMaidItem.getItem(YATouHouMaidItem.YELLOW_FOX),
                new ResourceLocation("slashblade:user"), (ClampedItemPropertyFunction) (p_174564_, p_174565_, p_174566_, p_174567_) -> {
            BladeModel.user = p_174566_;
            return 0;
        });
        ItemProperties.register( YAItem.getItem(YAItem.SlashBladeOfYakumoBlade),
                new ResourceLocation("slashblade:user"), (ClampedItemPropertyFunction) (p_174564_, p_174565_, p_174566_, p_174567_) -> {
                    BladeModel.user = p_174566_;
                    return 0;
                });
}
    @SubscribeEvent
    public static void Baked(ModelEvent.ModifyBakingResult event) {
        bakeBlade(YATouHouMaidItem.getItem(YATouHouMaidItem.YELLOW_FOX), event);
        bakeBlade(YAItem.getItem(YAItem.SlashBladeOfYakumoBlade), event);
    }
}